package com.ants.dgsxpt.web.common;

import com.ants.platform.core.bean.Page;
import com.ants.platform.core.service.RequestLogService;
import com.ants.platform.core.utils.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by liushun on 2016/8/22.
 */
@RestController
public class LogsAjax {

    @Autowired
    private RequestLogService logService;

    @RequestMapping(value = "/request/list", method = RequestMethod.POST)
    public Object list(@RequestParam Integer page
            , @RequestParam Integer rows
            , String orderField
            , String orderDirection) {
        Page p = logService.getList(page, rows, orderField, orderDirection);
        return ResponseUtil.easyuiResponse(p.getData(), p.getTotalCount());
    }

}
